package com.yutian.springboot.jdbctemplate.controller;

import com.yutian.springboot.jdbctemplate.biz.DataSourceMeta;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
@RequestMapping("/jdbc")
public class JdbcController {

    @Autowired
    private DataSourceMeta dataSourceMeta;

	@GetMapping("/validationQuery")
    @ResponseBody
    public Map<String, Object> getValidationQuery(Long id, HttpServletRequest httpRequest){
        Map<String, Object> res = new HashMap<>();
        res.put("validationQuery", dataSourceMeta.getValidationQuery());
        return res;
    }

}
